import re
from django.db import models


def check_phone(phone):
    """
    手机号校验
    :param phone: 手机号
    :return: True/None
    """
    ret = re.match('^1[3-9][0-9]{9}$', phone)
    if ret:
        return True
    return


class BaseModel(models.Model):
    is_show = models.BooleanField(verbose_name='展示', default=True)
    is_delete = models.BooleanField(verbose_name='删除', default=False)
    create_time = models.DateTimeField(verbose_name='创建时间', auto_now_add=True)
    update_time = models.DateTimeField(verbose_name='更新时间', auto_now=True)
    order = models.SmallIntegerField(verbose_name='排序', default=1)

    class Meta:
        # 抽象表
        abstract = True
